@extends('admin.layout')

@section('content')
  <div class='container'>
    <div class='row page-title-row'>
      <div class='col-md-6'>
        <h3>
          标签
          <small>» 列表</small>
        </h3>
      </div>
      <div class='col-md-6 text-right'>
        <a href='/admin/tag/create' class='btn btn-success btn-md'>
          <i class='fa fa-plus-circle'></i>新增标签
        </a>
      </div>
    </div>
    <div calss='row'>
      <div class='col-sm-12'>
        @include('admin.partials.errors')
        @include('admin.partials.success')

        <table id='tags-table' class='table table-striped table-bordered'>
          <thead>
            <tr>
              <th>标签</th>
              <th>标题</th>
              <th class='hidden-sm'>副标题</th>
              <th class='hidden-md'>页面图片</th>
              <th class='hidden-md'>描述信息</th>
              <th class='hidden-md'>布局</th>
              <th class='hidden-sm'>排序</th>
              <th data-sortable='false'>操作</th>
            </tr>
          </thead>
          <tbody>
          @foreach ($tags as $tag)
            <tr>
              <td>{{ $tag->tag }}</td>
              <td>{{ $tag->title }}</td>
              <td class='hidden-sm'>{{ $tag->subtitle }}</td>
              <td class='hidden-md'>{{ $tag->page_image }}</td>
              <td class='hidden-md'>{{ $tag->meta_description }}</td>
              <td class='hidden-md'>{{ $tag->layout }}</td>
              <td class='hidden-sm'>
                @if ($tag->reverse_direction)
                  逆序
                @else
                  升序
                @endif
              </td>
              <td>
                <a href='/admin/tag/{{ $tag->id }}/edit' class='btn btn-xs btn-info'>
                  <i class='fa fa-edit'></i>编辑
                </a>
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
      </div>
    </div>
  </div>
  @stop

  @section('script')
    <script>
      $(function(){
        $('#tags-table').DataTable({});
      })
    </script>
  @stop